<?php

$config=array();
$config["driver"]="mysqli";
$config["connect"]="default";
$config["varPage"]="page";
$config["pageSize"]=20;
$config["default"]=array(
    "pconnect"=>"0",
    "database"=>"mysqli",
    "db_host"=>env()->get("mysql.db_host","localhost"),
    "db_name"=>env()->get("mysql.db_name",""),
    "db_user"=>env()->get("mysql.db_user",""),
    "db_pwd"=>env()->get("mysql.db_pwd",""),
    "db_charset"=>"utf8mb4",
    "db_port"=>"3306",
    "tb_pre"=>env()->get("mysql.tb_pre",""),
    "ttl"=>"",//查询缓存时间
);
$config["tb_pre"]=env()->get("mysql.tb_pre","");

$config["default_connections"]="mysql";
$config["connections"]=array(
    'mysql'    =>    [
        // 数据库类型
        'type'        => '\app\utils\db\Custom_connection',
        'query'        => '\app\utils\db\Custom_query',
        'builder'        => '\yifang\db\builder\Mysql',
//        'type'        => 'mysql',
        // 服务器地址
        'hostname'    => env()->get("mysql.db_host","localhost"),
        // 数据库名
        'database'    =>env()->get("mysql.db_name",""),
        // 数据库用户名
        'username'    => env()->get("mysql.db_user",""),
        // 数据库密码
        'password'    => env()->get("mysql.db_pwd",""),
        // 数据库连接端口
        'hostport'    => '3306',
        // 数据库连接参数
        'params'      => [],
        // 数据库编码默认采用utf8
        'charset'     => 'utf8mb4',
        // 数据库表前缀
        'prefix'      => env()->get("mysql.tb_pre",""),
//        'deploy'   => 1,
//        'master_num'   => 1,
//        'rw_separate'   => true,
    ],
);
return $config;
